Skip to content

Add semantic logging#213

Open
billdueber wants to merge 3 commits intomainfrom
logging
Open

Add semantic logging#213
billdueber wants to merge 3 commits intomainfrom
logging

Conversation

@billdueber
Copy link
Copy Markdown
Collaborator

@billdueber billdueber commented Sep 26, 2024

Added rails_semantic_logger and configured rails to log :json results to STDOUT.

Tried to add remote_ip, which somehow isn't included in the standard json output.

Sample:

{
  "host": "2084e8bbbfe4",
  "application": "Semantic Logger",
  "environment": "development",
  "timestamp": "2024-09-26T01:49:13.474279Z",
  "level": "info",
  "level_index": 2,
  "pid": 1,
  "thread": "puma srv tp 001",
  "duration_ms": 486.46841700247023,
  "duration": "486.5ms",
  "named_tags": {
    "ip": "172.18.0.1"
  },
  "name": "CatalogController",
  "message": "Completed #show",
  "payload": {
    "controller": "CatalogController",
    "action": "show",
    "params": {
      "authenticity_token": "h1j+vgylJrYMC0LcLrGQb078b+FCvYeHfWeXKFHeVTOznH6Ah9zeUhSeXDud4VvGjJKx/+H2SxZiGEtdTl2qKQ==",
      "redirect": "/m/middle-english-dictionary/dictionary/MED124",
      "counter": "4",
      "search_id": "28",
      "id": "MED124"
    },
    "format": "HTML",
    "method": "POST",
    "path": "/m/middle-english-dictionary/dictionary/MED124/track",
    "status": 200,
    "view_runtime": 443.07,
    "db_runtime": 2.44,
    "status_message": "OK"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant